package com.liu.pool_study.diyPool;

import java.util.List;

/**
 * 需求，线程类
 */
public class MyWork extends Thread {

    private String name;//线程的名字
    private List<Runnable> tasks;//任务名字

    public MyWork(String name,List<Runnable> tasks) {
        this.name = name;
        this.tasks = tasks;
    }

    @Override
    public void run() {
        while (tasks.size() > 0) {
            Runnable remove = tasks.remove(0);
            remove.run();
        }
    }
}
